from django.contrib import admin

from prj004.models import (
    info, cure, summary, history, relevant,
    result, clinical, status
)
from prj004.utils import samecode


@admin.register(info.Info)
class InfoAdmin(admin.ModelAdmin):
    list_display = ('serial', 'patient_name', 'check_status', 'create_time', 'owner')


@admin.register(summary.Summary)
class SummaryAdmin(admin.ModelAdmin, samecode.SameCodeAdmin):
    list_display = ('id', 'zhusu', 'create_time', 'owner_link', 'info_link', )


@admin.register(history.History)
class HistoryAdmin(admin.ModelAdmin, samecode.SameCodeAdmin):
    list_display = ('id', 'history_wu', 'create_time', 'owner_link', 'info_link', )


@admin.register(relevant.Relevant)
class RelevantAdmin(admin.ModelAdmin, samecode.SameCodeAdmin):
    list_display = ('id', 'tige_check_wu', 'create_time', 'owner_link', 'info_link',)


@admin.register(clinical.Clinical)
class ClinicalAdmin(admin.ModelAdmin, samecode.SameCodeAdmin):
    list_display = ('id', 'zhong_hua', 'create_time', 'owner_link', 'info_link')


@admin.register(cure.Cure)
class CureAdmin(admin.ModelAdmin, samecode.SameCodeAdmin):
    list_display = ('id', 'is_jiehe', 'create_time', 'owner_link', 'info_link')


@admin.register(result.Result)
class ResultAdmin(admin.ModelAdmin, samecode.SameCodeAdmin):
    list_display = ('id', 'jinqi_cure', 'create_time', 'owner_link', 'info_link')


@admin.register(status.InfoStatus)
class InfoStatusAdmin(admin.ModelAdmin):
    list_display = ('id', 'info_serial', 'fix_name_chinese', 'fix_before', 'fix_after')
    search_fields = ['id', ]
    list_filter = ['id', ]
